package com.ruoyi.system.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.ArchiveReceiveStat;
import com.ruoyi.system.domain.SysTable;
import com.ruoyi.system.service.ArchiveReceiveStatService;
import com.ruoyi.system.service.SysTableService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Objects;

/**
 * 档案接收统计 Controller
 *
 * @author 你的名字
 */
@RestController
@RequestMapping("/system/systable")
public class SystemTableController {
    @Autowired
    private SysTableService sysTableService;

    /**
     * 查询档案接收统计列表
     */
    @GetMapping("/list")
    public AjaxResult list(SysTable sysTable) {
        List<SysTable> list = sysTableService.selectSysTableList(sysTable);
        return AjaxResult.success(list);
    }



    /**
     * 批量保存档案接收统计（先删后插）
     */
    @PostMapping("/batchSave")
    public AjaxResult batchSave(@RequestBody SysTable sysTable) {
        if (sysTable == null) {
            return AjaxResult.error("批量新增数据不能为空");
        }
        return AjaxResult.success(sysTableService.insertSysTableInfo(sysTable));
    }
}